﻿<UserControl x:Class="YouTube.VideoItem"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Width="126" Height="128">
    <DockPanel>
        <TextBlock DockPanel.Dock="Bottom" Text="{Binding Title}" ToolTip="{Binding Title}" HorizontalAlignment="Left"
                           TextWrapping="WrapWithOverflow" TextTrimming="CharacterEllipsis" Height="32" Width="120" />
        <Border BorderBrush="Black" BorderThickness="1" Margin="2" Background="Black">
            <Grid>
                <Image Source="{Binding ThumbUri}" Stretch="Uniform" StretchDirection="DownOnly" Width="120" Height="90" />
                <Border Name="mediaElementBorder" IsHitTestVisible="False" RenderTransformOrigin="0.5,0.5" Background="Black" Visibility="Collapsed">
                    <!--<Border.RenderTransform>
                        <ScaleTransform ScaleX="2" ScaleY="2" />
                    </Border.RenderTransform>-->
                    <Grid>
                        <TextBlock SnapsToDevicePixels="True" Background="Black" Foreground="White" Text="Loading..." HorizontalAlignment="Center" VerticalAlignment="Center" />
                        <TextBlock Name="noVideoLinkText" Visibility="Collapsed" SnapsToDevicePixels="True" Background="Black" Foreground="White" Text="No video link!" HorizontalAlignment="Center" VerticalAlignment="Center" TextAlignment="Center" />
                        <MediaElement Name="mediaElement" IsHitTestVisible="False" Width="120" Height="90" LoadedBehavior="Manual" UnloadedBehavior="Manual" />
                    </Grid>
                </Border>
            </Grid>
        </Border>
    </DockPanel>
</UserControl>
